package com.menghai.mongoDB;

import java.net.UnknownHostException;
import java.util.List;

import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.Mongo;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Mongo mongo;
		try {
			mongo = mongo = new Mongo("192.168.1.232",27017);
			DB db = mongo.getDB("mts");
			db.requestStart();
			DBCollection collectionhhh = db.getCollection("mts_user_result");
			collectionhhh.save(new BasicDBObject("name","xt"));
			int i = 5/0;
			collectionhhh.save(new BasicDBObject("name","xt1"));
			db.requestDone();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		
	}

}
